<?php

$images_url = base_url('images');
$main_url = base_url('main');
$upload_url = base_url('uploads');



$mapdir = "
	<a href='$main_url'>Home</a>
	&gt; 
	<b>Daftar Event</b>
";


$dataacara = "";

$awal = $this->input->get(3, 0);
$acara = $this->mainmodel->get_daftar_acara($awal);
try{
	$hit = $awal+1;
}catch (Exception $e){
	$hit = 1;
}

$dataacara = "";

	$awal = $this->input->get(3, 0);
	$acara = $this->mainmodel->get_daftar_acara($awal);
	try{
		$hit = $awal+1;
	}catch (Exception $e){
		$hit = 1;
	}
	
	$config['base_url'] = base_url('main/acara');
	$config['total_rows'] = $this->mainmodel->hitung_data('idacara','dn_event');
	$config['per_page'] = 10; 
	$config['page_query_string'] = TRUE; 
	$config['query_string_segment'] = 'awal';
	$config['suffix'] = '/list.html?acara=ya';
	
	$this->pagination->initialize($config);	
	$halaman = $this->pagination->create_links();

	if($acara !== FALSE)
	{
		$jumlah = $acara->num_rows();
		$tengah = ceil($jumlah/2);
		$ackanan = "";
		$ackiri = "";
	
		foreach($acara->result() AS $dacara)
		{
			$title = url_title($dacara->nama, '-', TRUE);
			
			if($hit % 2 == 0)
			{
				$warna = "bgputih";
			}
			else
			{
				$warna = "bgbiru";
			}
			
			if($hit <= $tengah)
			{
				$ackanan .= "<div class='$warna'  style='width:100%'>$hit. <a href='$main_url/detail/$dacara->idacara/acara/$title.html' >$dacara->nama</a></div> ";
			}
			else
			{
				$ackiri .= "<div class='$warna'  style='width:100%'>$hit. <a href='$main_url/detail/$dacara->idacara/acara/$title.html' >$dacara->nama</a></div> ";
			}
			
		
			$hit++;
		}
		
		if($jumlah % 2 == 1)
		{
			$ackiri .= "<div style='width:100%'>&nbsp</div> ";
		}
		
	}
	else 
	{
		$ackanan = "&nbsp;";
		$ackiri = "Tidak ada acara saat ini";
	}
	
	$dataacara .= "
			<tr>
				<td class='left'>$ackanan</td>
				<td class='right'>$ackiri</td>
			</tr>
			<tr>
			<td class='left'>&nbsp;</td>
			<td class='right'>$halaman</td>
			</tr>
	";
	
$isipage = "
	<div id='content2'>
			<h3>Daftar Acara</h3>
				
				
				
				<div class='isicontent2'>
				
					<table>
						<tbody>
						
							$dataacara
							
						</tbody>
					</table>
				  
				  
				</div>
			</div>
";

$data['map_dir'] = $mapdir;
$data['isi_page'] = $isipage;
$data['site_title'] = 'Event - Dadan Network';
$data['site_description'] = 'Dadan Network adalah situs berbagi informasi tentang jaringan profesional antar enterpreneur indonesia';
$data['site_keywords'] = 'dadan, network, profesional, enterpreneur, produk, usaha';
$data['base_url'] = base_url();
$data['tahun_sekarang'] = date("Y");
$data['other_head'] = '';


$this->parser->parse('template/home', $data);

/* End of file acara.php */
/* Location: ./application/views/main/acara.php */
